package com.responsibilityChain;

//院长审批
public class ColleageApprover extends Approver{

    public ColleageApprover(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest purchaseRequest) {
        if (purchaseRequest.getCost() > 5000 && purchaseRequest.getCost() <= 10000){
            System.out.println("请求编号：【"+purchaseRequest.getId()+"】 审批金额："+purchaseRequest.getCost());
            System.out.println(name+"【审批通过】");
        }else {
            //不是我能处理的就交给下一个处理者
            System.out.println(name +"处理不了交给下个处理者:"+nextApprover.name);
            System.out.println("--------------------");
            nextApprover.processRequest(purchaseRequest);
        }
    }
}
